package com.hmy.finance.bo.receiveAdjust.request;

import com.hmy.finance.dal.po.receiveAdjust.ReceiveAdjustDetailPo;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

@Data
public class SaveReceiveAdjustRequest {

    /**
     * 应收调整id
     */
    private Long adjustId;

    /**
     * 合同id
     */
    @NotNull(groups = {Submit.class, Save.class}, message = "合同id不能为空")
    private Long contractId;

    /**
     * 合同编号
     */
    @NotBlank(groups = {Submit.class, Save.class}, message = "合同编号不能为空")
    private String contractNo;

    /**
     * 项目id
     */
    @NotNull(groups = Submit.class, message = "项目id不能为空")
    private String projectId;

    /**
     * 项目名称
     */
    @NotBlank(groups = Submit.class, message = "项目名称不能为空")
    private String projectName;

    /**
     * 合同应收总额
     */
    @NotNull(groups = {Submit.class, Save.class}, message = "合同应收总额不能为空")
    private BigDecimal contractReceiveTotalAmount;

    /**
     * 签约人id
     */
    private Long signatoryId;

    /**
     * 签约人
     */
    private String signatory;

    /**
     * 签约人
     */
    private String signatoryPhone;

    /**
     * 客户id
     */
    @NotNull(groups = Submit.class, message = "客户id不能为空")
    private Long customerId;

    /**
     * 客户名称
     */
    @NotBlank(groups = Submit.class, message = "客户名称不能为空")
    private String customerName;

    /**
     * 客户联系方式
     */
    private String customerPhone;

    /**
     * 调整原因
     */
    @NotNull(groups = {Submit.class, Save.class}, message = "调整原因不能为空")
    private String[] adjustReason;

    /**
     * 详细原因
     */
    @NotBlank(groups = {Submit.class, Save.class}, message = "详细原因不能为空")
    private String adjustDetailReason;

    /**
     * 历史调整行为：0-否，1-是
     */
    @NotNull(groups = Submit.class, message = "历史调整行为不能为空")
    private Integer historyAdjust;

    /**
     * 截止时间
     */
    @NotNull(groups = Submit.class, message = "截止时间不能为空")
    private LocalDate endTime;

    /**
     * 上传单据
     */
    @NotBlank(groups = Submit.class, message = "上传单据不能为空")
    private String uploadFile;

    /**
     * 应收调整详情
     */
    @NotEmpty(groups = Submit.class, message = "调整信息不能为空")
    private List<ReceiveAdjustDetailPo> receiveAdjustDetails;


    public interface Save {

    }

    public interface Submit {

    }
}
